import { Http } from '@/utils/Http.js'

export const GoodsApi = {

    /**
     * 分页获取商品
     * @returns
     */
    getGoodsMainPage: (param) => {
        return Http.request({
            'url': '/app/food/goods/getGoodsMainPage',
            'method': 'post',
            'data': param
        })
    },

    /**
     * 根据公共商品id查询子商品
     * @returns
     */
    getGoodsList: (mainGoodsId) => {
        return Http.request({
            'url': '/app/food/goods/getGoodsList',
            'method': 'get',
            'data': {mainGoodsId:mainGoodsId}
        })
    },

    /**
     * 热销商品
     * @returns
     */
    listSalesGoods: (num) => {
        return Http.request({
            'url': '/app/food/goods/listSalesGoods',
            'method': 'get',
            'data': {num:num}
        })
    },

    /**
     * 公共商品详情
     * @returns
     */
    getGoodsMainDetail: (mainGoodsId) => {
        return Http.request({
            'url': '/app/food/goods/getGoodsMainDetail',
            'method': 'get',
            'data': {mainGoodsId:mainGoodsId}
        })
    },

    /**
     * 获取商品信息列表
     * @returns
     */
    listGoodsByOrder: (param) => {
        return Http.request({
            'url': '/app/food/goods/listGoodsByOrder',
            'method': 'post',
            'data': param
        })
    },

    /**
     * 分页获取商品系列
     * @returns
     */
    getDesignGoodsPage: (param) => {
        return Http.request({
            'url': '/app/food/goods/getDesignGoodsPage',
            'method': 'post',
            'data': param
        })
    },

    /**
     * 商品搜索
     * @returns
     */
    getSearchGoodsPage: (param) => {
        return Http.request({
            'url': '/app/food/goods/getSearchGoodsPage',
            'method': 'post',
            'data': param
        })
    }
}
